package fr.efrei.musicpliz.dao;

import java.util.List;

import fr.efrei.musicpliz.dto.CompteDto;
import fr.efrei.musicpliz.entity.Compte;

/**
 * Data Access Object to grant access to all the account-entities.
 * fetch, update, insert and delete statements should be encapsulated by this DAO
 */
public interface CompteDao extends AbstractDao<Compte> {
	
	/**
	 * Get a <b>Compte</b> by the eMail address (the ID)
	 * @param email
	 * 		The name of the email address
	 * @return
	 * 		the Compte with the specified email address
	 */
	public Compte getCompteForEmail(String email);
	
	public Compte getCompteForId(int id);

	/**
	 * Fetches all existing <b>comptes of a certain type</b> from the db
	 * 
	 * @param <T>
	 * 		Type of the Compte you d'like to receive
	 * @param instance
	 * 		provide an instance for extracting the class-information
	 * 
	 * @return List with all <b>specific comptes</b> saved on the db
	 */
	<T extends Compte>List<T> getAllComptes(T instance);

	/**
	 * Get all <b>Comptes</b> corresponding to the data in the Dto
	 * @param dto
	 * 		All the restrictions (AND-connected)
	 * @return
	 * 		A List of all the Compte's found on the DB
	 */
	List<Compte> searchComptesForDto(CompteDto dto);
}
